3.290 \(\int \cos (c+d x) \sqrt{a+i a \tan (c+d x)} \, dx\)

Optimal. Leaf size=83 \[ \frac{i \sqrt{a} \tanh ^{-1}\left (\frac{\sqrt{a} \sec (c+d x)}{\sqrt{2} \sqrt{a+i a \tan (c+d x)}}\right )}{\sqrt{2} d}-\frac{i \cos (c+d x) \sqrt{a+i a \tan (c+d x)}}{d} \]

[Out]

(I*Sqrt[a]*ArcTanh[(Sqrt[a]*Sec[c + d*x])/(Sqrt[2]*Sqrt[a + I*a*Tan[c + d*x]])])/(Sqrt[2]*d) - (I*Cos[c + d*x]
*Sqrt[a + I*a*Tan[c + d*x]])/d

________________________________________________________________________________________

Rubi [A]  time = 0.0937708, antiderivative size = 83, normalized size of antiderivative = 1., number of steps used = 3, number of rules used = 3, integrand size = 24, \(\frac{\text{number of rules}}{\text{integrand size}}\) = 0.125, Rules used = {3490, 3489, 206} \[ \frac{i \sqrt{a} \tanh ^{-1}\left (\frac{\sqrt{a} \sec (c+d x)}{\sqrt{2} \sqrt{a+i a \tan (c+d x)}}\right )}{\sqrt{2} d}-\frac{i \cos (c+d x) \sqrt{a+i a \tan (c+d x)}}{d} \]

Antiderivative was successfully verified.

[In]

Int[Cos[c + d*x]*Sqrt[a + I*a*Tan[c + d*x]],x]

[Out]

(I*Sqrt[a]*ArcTanh[(Sqrt[a]*Sec[c + d*x])/(Sqrt[2]*Sqrt[a + I*a*Tan[c + d*x]])])/(Sqrt[2]*d) - (I*Cos[c + d*x]
*Sqrt[a + I*a*Tan[c + d*x]])/d

Rule 3490

Int[((d_.)*sec[(e_.) + (f_.)*(x_)])^(m_.)*((a_) + (b_.)*tan[(e_.) + (f_.)*(x_)])^(n_), x_Symbol] :> Simp[(b*(d
*Sec[e + f*x])^m*(a + b*Tan[e + f*x])^n)/(a*f*m), x] + Dist[a/(2*d^2), Int[(d*Sec[e + f*x])^(m + 2)*(a + b*Tan
[e + f*x])^(n - 1), x], x] /; FreeQ[{a, b, d, e, f}, x] && EqQ[a^2 + b^2, 0] && EqQ[m/2 + n, 0] && GtQ[n, 0]

Rule 3489

Int[sec[(e_.) + (f_.)*(x_)]/Sqrt[(a_) + (b_.)*tan[(e_.) + (f_.)*(x_)]], x_Symbol] :> Dist[(-2*a)/(b*f), Subst[
Int[1/(2 - a*x^2), x], x, Sec[e + f*x]/Sqrt[a + b*Tan[e + f*x]]], x] /; FreeQ[{a, b, e, f}, x] && EqQ[a^2 + b^
2, 0]

Rule 206

Int[((a_) + (b_.)*(x_)^2)^(-1), x_Symbol] :> Simp[(1*ArcTanh[(Rt[-b, 2]*x)/Rt[a, 2]])/(Rt[a, 2]*Rt[-b, 2]), x]
 /; FreeQ[{a, b}, x] && NegQ[a/b] && (GtQ[a, 0] || LtQ[b, 0])

Rubi steps

\begin{align*} \int \cos (c+d x) \sqrt{a+i a \tan (c+d x)} \, dx &=-\frac{i \cos (c+d x) \sqrt{a+i a \tan (c+d x)}}{d}+\frac{1}{2} a \int \frac{\sec (c+d x)}{\sqrt{a+i a \tan (c+d x)}} \, dx\\ &=-\frac{i \cos (c+d x) \sqrt{a+i a \tan (c+d x)}}{d}+\frac{(i a) \operatorname{Subst}\left (\int \frac{1}{2-a x^2} \, dx,x,\frac{\sec (c+d x)}{\sqrt{a+i a \tan (c+d x)}}\right )}{d}\\ &=\frac{i \sqrt{a} \tanh ^{-1}\left (\frac{\sqrt{a} \sec (c+d x)}{\sqrt{2} \sqrt{a+i a \tan (c+d x)}}\right )}{\sqrt{2} d}-\frac{i \cos (c+d x) \sqrt{a+i a \tan (c+d x)}}{d}\\ \end{align*}

Mathematica [A]  time = 0.517113, size = 87, normalized size = 1.05 \[ -\frac{i e^{-i (c+d x)} \left (e^{2 i (c+d x)}-\sqrt{1+e^{2 i (c+d x)}} \tanh ^{-1}\left (\sqrt{1+e^{2 i (c+d x)}}\right )+1\right ) \sqrt{a+i a \tan (c+d x)}}{2 d} \]

Antiderivative was successfully verified.

[In]

Integrate[Cos[c + d*x]*Sqrt[a + I*a*Tan[c + d*x]],x]

[Out]

((-I/2)*(1 + E^((2*I)*(c + d*x)) - Sqrt[1 + E^((2*I)*(c + d*x))]*ArcTanh[Sqrt[1 + E^((2*I)*(c + d*x))]])*Sqrt[
a + I*a*Tan[c + d*x]])/(d*E^(I*(c + d*x)))

________________________________________________________________________________________

Maple [B]  time = 0.322, size = 217, normalized size = 2.6 \begin{align*} -{\frac{1}{2\,d \left ( i\sin \left ( dx+c \right ) +\cos \left ( dx+c \right ) -1 \right ) } \left ( i\sqrt{2}{\it Artanh} \left ({\frac{\sqrt{2}\sin \left ( dx+c \right ) }{2\,\cos \left ( dx+c \right ) }\sqrt{-2\,{\frac{\cos \left ( dx+c \right ) }{\cos \left ( dx+c \right ) +1}}}} \right ) \sqrt{-2\,{\frac{\cos \left ( dx+c \right ) }{\cos \left ( dx+c \right ) +1}}}\sin \left ( dx+c \right ) -\sqrt{2}\arctan \left ({\frac{\sqrt{2}}{2}\sqrt{-2\,{\frac{\cos \left ( dx+c \right ) }{\cos \left ( dx+c \right ) +1}}}} \right ) \sqrt{-2\,{\frac{\cos \left ( dx+c \right ) }{\cos \left ( dx+c \right ) +1}}}\sin \left ( dx+c \right ) +2\,i \left ( \cos \left ( dx+c \right ) \right ) ^{2}-2\,i\cos \left ( dx+c \right ) -2\,\cos \left ( dx+c \right ) \sin \left ( dx+c \right ) \right ) \sqrt{{\frac{a \left ( i\sin \left ( dx+c \right ) +\cos \left ( dx+c \right ) \right ) }{\cos \left ( dx+c \right ) }}}} \end{align*}

Verification of antiderivative is not currently implemented for this CAS.

[In]

int(cos(d*x+c)*(a+I*a*tan(d*x+c))^(1/2),x)

[Out]

-1/2/d*(I*2^(1/2)*arctanh(1/2*2^(1/2)*(-2*cos(d*x+c)/(cos(d*x+c)+1))^(1/2)*sin(d*x+c)/cos(d*x+c))*(-2*cos(d*x+
c)/(cos(d*x+c)+1))^(1/2)*sin(d*x+c)-2^(1/2)*arctan(1/2*2^(1/2)*(-2*cos(d*x+c)/(cos(d*x+c)+1))^(1/2))*(-2*cos(d
*x+c)/(cos(d*x+c)+1))^(1/2)*sin(d*x+c)+2*I*cos(d*x+c)^2-2*I*cos(d*x+c)-2*cos(d*x+c)*sin(d*x+c))*(a*(I*sin(d*x+
c)+cos(d*x+c))/cos(d*x+c))^(1/2)/(I*sin(d*x+c)+cos(d*x+c)-1)

________________________________________________________________________________________

Maxima [B]  time = 1.97359, size = 1045, normalized size = 12.59 \begin{align*} \text{result too large to display} \end{align*}

Verification of antiderivative is not currently implemented for this CAS.

[In]

integrate(cos(d*x+c)*(a+I*a*tan(d*x+c))^(1/2),x, algorithm="maxima")

[Out]

1/8*((cos(2*d*x + 2*c)^2 + sin(2*d*x + 2*c)^2 + 2*cos(2*d*x + 2*c) + 1)^(1/4)*(-4*I*sqrt(2)*cos(1/2*arctan2(si
n(2*d*x + 2*c), cos(2*d*x + 2*c) + 1)) + 4*sqrt(2)*sin(1/2*arctan2(sin(2*d*x + 2*c), cos(2*d*x + 2*c) + 1)))*s
qrt(a) - (2*sqrt(2)*arctan2((cos(2*d*x + 2*c)^2 + sin(2*d*x + 2*c)^2 + 2*cos(2*d*x + 2*c) + 1)^(1/4)*sin(1/2*a
rctan2(sin(2*d*x + 2*c), cos(2*d*x + 2*c) + 1)), (cos(2*d*x + 2*c)^2 + sin(2*d*x + 2*c)^2 + 2*cos(2*d*x + 2*c)
 + 1)^(1/4)*cos(1/2*arctan2(sin(2*d*x + 2*c), cos(2*d*x + 2*c) + 1)) + 1) - 2*sqrt(2)*arctan2((cos(2*d*x + 2*c
)^2 + sin(2*d*x + 2*c)^2 + 2*cos(2*d*x + 2*c) + 1)^(1/4)*sin(1/2*arctan2(sin(2*d*x + 2*c), cos(2*d*x + 2*c) +
1)), (cos(2*d*x + 2*c)^2 + sin(2*d*x + 2*c)^2 + 2*cos(2*d*x + 2*c) + 1)^(1/4)*cos(1/2*arctan2(sin(2*d*x + 2*c)
, cos(2*d*x + 2*c) + 1)) - 1) - I*sqrt(2)*log(sqrt(cos(2*d*x + 2*c)^2 + sin(2*d*x + 2*c)^2 + 2*cos(2*d*x + 2*c
) + 1)*cos(1/2*arctan2(sin(2*d*x + 2*c), cos(2*d*x + 2*c) + 1))^2 + sqrt(cos(2*d*x + 2*c)^2 + sin(2*d*x + 2*c)
^2 + 2*cos(2*d*x + 2*c) + 1)*sin(1/2*arctan2(sin(2*d*x + 2*c), cos(2*d*x + 2*c) + 1))^2 + 2*(cos(2*d*x + 2*c)^
2 + sin(2*d*x + 2*c)^2 + 2*cos(2*d*x + 2*c) + 1)^(1/4)*cos(1/2*arctan2(sin(2*d*x + 2*c), cos(2*d*x + 2*c) + 1)
) + 1) + I*sqrt(2)*log(sqrt(cos(2*d*x + 2*c)^2 + sin(2*d*x + 2*c)^2 + 2*cos(2*d*x + 2*c) + 1)*cos(1/2*arctan2(
sin(2*d*x + 2*c), cos(2*d*x + 2*c) + 1))^2 + sqrt(cos(2*d*x + 2*c)^2 + sin(2*d*x + 2*c)^2 + 2*cos(2*d*x + 2*c)
 + 1)*sin(1/2*arctan2(sin(2*d*x + 2*c), cos(2*d*x + 2*c) + 1))^2 - 2*(cos(2*d*x + 2*c)^2 + sin(2*d*x + 2*c)^2
+ 2*cos(2*d*x + 2*c) + 1)^(1/4)*cos(1/2*arctan2(sin(2*d*x + 2*c), cos(2*d*x + 2*c) + 1)) + 1))*sqrt(a))/d

________________________________________________________________________________________

Fricas [B]  time = 2.35262, size = 690, normalized size = 8.31 \begin{align*} -\frac{{\left (\sqrt{\frac{1}{2}} d \sqrt{-\frac{a}{d^{2}}} e^{\left (i \, d x + i \, c\right )} \log \left ({\left (2 i \, \sqrt{\frac{1}{2}} d \sqrt{-\frac{a}{d^{2}}} e^{\left (i \, d x + i \, c\right )} + \sqrt{2} \sqrt{\frac{a}{e^{\left (2 i \, d x + 2 i \, c\right )} + 1}}{\left (e^{\left (2 i \, d x + 2 i \, c\right )} + 1\right )} e^{\left (i \, d x + i \, c\right )}\right )} e^{\left (-i \, d x - i \, c\right )}\right ) - \sqrt{\frac{1}{2}} d \sqrt{-\frac{a}{d^{2}}} e^{\left (i \, d x + i \, c\right )} \log \left ({\left (-2 i \, \sqrt{\frac{1}{2}} d \sqrt{-\frac{a}{d^{2}}} e^{\left (i \, d x + i \, c\right )} + \sqrt{2} \sqrt{\frac{a}{e^{\left (2 i \, d x + 2 i \, c\right )} + 1}}{\left (e^{\left (2 i \, d x + 2 i \, c\right )} + 1\right )} e^{\left (i \, d x + i \, c\right )}\right )} e^{\left (-i \, d x - i \, c\right )}\right ) - \sqrt{2} \sqrt{\frac{a}{e^{\left (2 i \, d x + 2 i \, c\right )} + 1}}{\left (-i \, e^{\left (2 i \, d x + 2 i \, c\right )} - i\right )} e^{\left (i \, d x + i \, c\right )}\right )} e^{\left (-i \, d x - i \, c\right )}}{2 \, d} \end{align*}

Verification of antiderivative is not currently implemented for this CAS.

[In]

integrate(cos(d*x+c)*(a+I*a*tan(d*x+c))^(1/2),x, algorithm="fricas")

[Out]

-1/2*(sqrt(1/2)*d*sqrt(-a/d^2)*e^(I*d*x + I*c)*log((2*I*sqrt(1/2)*d*sqrt(-a/d^2)*e^(I*d*x + I*c) + sqrt(2)*sqr
t(a/(e^(2*I*d*x + 2*I*c) + 1))*(e^(2*I*d*x + 2*I*c) + 1)*e^(I*d*x + I*c))*e^(-I*d*x - I*c)) - sqrt(1/2)*d*sqrt
(-a/d^2)*e^(I*d*x + I*c)*log((-2*I*sqrt(1/2)*d*sqrt(-a/d^2)*e^(I*d*x + I*c) + sqrt(2)*sqrt(a/(e^(2*I*d*x + 2*I
*c) + 1))*(e^(2*I*d*x + 2*I*c) + 1)*e^(I*d*x + I*c))*e^(-I*d*x - I*c)) - sqrt(2)*sqrt(a/(e^(2*I*d*x + 2*I*c) +
 1))*(-I*e^(2*I*d*x + 2*I*c) - I)*e^(I*d*x + I*c))*e^(-I*d*x - I*c)/d

________________________________________________________________________________________

Sympy [F]  time = 0., size = 0, normalized size = 0. \begin{align*} \int \sqrt{a \left (i \tan{\left (c + d x \right )} + 1\right )} \cos{\left (c + d x \right )}\, dx \end{align*}

Verification of antiderivative is not currently implemented for this CAS.

[In]

integrate(cos(d*x+c)*(a+I*a*tan(d*x+c))**(1/2),x)

[Out]

Integral(sqrt(a*(I*tan(c + d*x) + 1))*cos(c + d*x), x)

________________________________________________________________________________________

Giac [F]  time = 0., size = 0, normalized size = 0. \begin{align*} \int \sqrt{i \, a \tan \left (d x + c\right ) + a} \cos \left (d x + c\right )\,{d x} \end{align*}

Verification of antiderivative is not currently implemented for this CAS.

[In]

integrate(cos(d*x+c)*(a+I*a*tan(d*x+c))^(1/2),x, algorithm="giac")

[Out]

integrate(sqrt(I*a*tan(d*x + c) + a)*cos(d*x + c), x)